import React from 'react';
import {Table, Row, Col, Form, Input, Icon, InputNumber, Radio, DatePicker, Select, Upload, Button, Switch, Modal, Popconfirm, Tabs, message, Steps} from 'antd';
import Inoviceheader from '../../drawback/Inoviceheader'
import Inoviceproducts from '../../drawback/Inoviceproducts';
const R = require('ramda');
export default class OrderInfo extends React.Component {
    constructor(props)
    {
        super(props);
        this.state={
            open:false,

        }
    }

    handleOpen=()=>{
        this.setState({ open:true})
    };


    handleCancel=()=>
    {
      this.setState({ open:false})
    };

    render()
    {
        let footer=[];
        footer.push(<Button key="cancel" size="large" onClick={this.handleCancel.bind(this, true)}>取消</Button>);
        let invoices = R.isNil(this.props.invoices)  ? {} : this.props.invoices;
        let inoviceproductsList = R.isNil(this.props.inoviceproductsList)  ? [] : this.props.inoviceproductsList;
        return(
            <Modal maskClosable={false} visible={this.state.open} title={"收票详情"} width={1000} wrapClassName="vertical-center-modal"
                   footer={footer}
                   onCancel={this.handleCancel.bind(this)} onOk={this.handleCancel.bind(this)}>

                <Inoviceheader wrappedComponentRef={(inst) => this.inoviceheader = inst} dispatch={this.props.dispatch}
                               dataSource={invoices}/>

                <Inoviceproducts wrappedComponentRef={(inst) => this.inoviceproducts = inst} dispatch={this.props.dispatch}
                                 dataSource={inoviceproductsList}/>

            </Modal>
        )
    }

}